package com.orhon.smartcampus.modules.student.fetcher;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.orhon.smartcampus.modules.student.mutation.AddArrivesMutation;
import com.orhon.smartcampus.modules.student.mutation.AddEclassHeadTeacherMutation;
import com.orhon.smartcampus.modules.student.mutation.AddEclassMutation;
import com.orhon.smartcampus.modules.student.mutation.AddEclassRecordsMutation;
import com.orhon.smartcampus.modules.student.mutation.AddExtendMutation;
import com.orhon.smartcampus.modules.student.mutation.AddHonorMutation;
import com.orhon.smartcampus.modules.student.mutation.AddLearninfoMutation;
import com.orhon.smartcampus.modules.student.mutation.AddParentsMutation;
import com.orhon.smartcampus.modules.student.mutation.AddRewardsMutation;
import com.orhon.smartcampus.modules.student.mutation.AddStudentMutation;
import com.orhon.smartcampus.modules.student.mutation.AddTrafficMutation;
import com.orhon.smartcampus.modules.student.mutation.DeleteArrivesMutation;
import com.orhon.smartcampus.modules.student.mutation.DeleteEclassHeadTeacherMutation;
import com.orhon.smartcampus.modules.student.mutation.DeleteEclassMutation;
import com.orhon.smartcampus.modules.student.mutation.DeleteEclassRecordsMutation;
import com.orhon.smartcampus.modules.student.mutation.DeleteExtendsMutation;
import com.orhon.smartcampus.modules.student.mutation.DeleteHonorMutation;
import com.orhon.smartcampus.modules.student.mutation.DeleteLearninfoMutation;
import com.orhon.smartcampus.modules.student.mutation.DeleteParentsMutation;
import com.orhon.smartcampus.modules.student.mutation.DeleteRewardsMutation;
import com.orhon.smartcampus.modules.student.mutation.DeleteStudentMutation;
import com.orhon.smartcampus.modules.student.mutation.DeleteTrafficMutation;
import com.orhon.smartcampus.modules.student.mutation.UpgradeSchoolYearMutation;

import graphql.schema.idl.RuntimeWiring;

@Component
public class StudentFetchersLoader {
	
	@Autowired
	private StatisticsFetcher statisticsFetcher;
	

	@Autowired
	LearninfoFetcher learninfoFetcher;
	
	@Autowired
	LearninfosFetcher learninfosFetcher;
	
	@Autowired
	EclassHeadteacherFetcher eclassHeadteacherFetcher;
    
    @Autowired
    EclassHeadteachersFetcher eclassHeadteachersFetcher;

    @Autowired
    EclassRecordsFetcher eclassRecordsFetcher;

    @Autowired
    EclassRecordssFetcher eclassRecordssFetcher;
	
//    @Autowired
//    StudentFetcher studentFetcher;
    
    @Autowired
    StudentsFetcher studentsFetcher;

    @Autowired
    ArrivesFetcher arrivesFetcher;

    @Autowired
    ArriveFetcher arriveFetcher;

    @Autowired
    EclasssFetcher eclassesFetcher;

    @Autowired
    RegionEclassesFetcher regionEclassesFetcher;

    @Autowired
    EclassFetcher eclassFetcher;

    @Autowired
    AddStudentMutation addStudentMutation;

    @Autowired
    DeleteStudentMutation deleteStudentMutation;

    @Autowired
    AddLearninfoMutation addLearninfoMutation;

    @Autowired
    DeleteLearninfoMutation deleteLearninfoMutation;

    @Autowired
    AddEclassMutation addEclassMutation;

    @Autowired
    DeleteEclassMutation deleteEclassMutation;

    @Autowired
    AddArrivesMutation addArrivesMutation;

    @Autowired
    DeleteArrivesMutation deleteArrivesMutation;

    @Autowired
    AddEclassHeadTeacherMutation addEclassHeadTeacherMutation;

    @Autowired
    DeleteEclassHeadTeacherMutation deleteEclassHeadTeacherMutation;

    @Autowired
    UpgradeSchoolYearMutation upgradeSchoolYearMutation;
    
    @Autowired
    ExtendsFetcher extendsFetcher;
    @Autowired
    AddExtendMutation addExtendMutation;
    @Autowired
    DeleteExtendsMutation deleteExtendsMutation;
    
    @Autowired
    ParentsFetcher parentsFetcher;
    @Autowired
    AddParentsMutation addParentsMutation;
    @Autowired
    DeleteParentsMutation deleteParentsMutation;
    
    @Autowired
    TrafficsFetcher trafficsFetcher;
    @Autowired
    AddTrafficMutation addTrafficMutation;
    @Autowired
    DeleteTrafficMutation deleteTrafficMutation;
    
    @Autowired
    HonorsFetcher honorsFetcher;
    @Autowired
    AddHonorMutation addHonorMutation;
    @Autowired
    DeleteHonorMutation deleteHonorMutation;
    
    @Autowired
    RewardsFetcher rewardsFetcher;
    @Autowired
    AddRewardsMutation addRewardsMutation;
    @Autowired
    DeleteRewardsMutation deleteRewardsMutation;
    
    @Autowired
    OperatingFetcher operatingFetcher;
    
    @Autowired
    AddEclassRecordsMutation addEclassRecordsMutation;
    @Autowired
    DeleteEclassRecordsMutation deleteEclassRecordsMutation;


    @Autowired
    StudentByIdsFetcher studentByIdsFetcher;


    public void LoadFetchers(RuntimeWiring.Builder builder){


        //users -> data
    	builder.type("Query" , t->t.dataFetcher("statistics" , statisticsFetcher));
    	builder.type("Query" , t->t.dataFetcher("studentLearnInfo" , learninfoFetcher));
    	builder.type("Query" , t->t.dataFetcher("studentLearnInfos" , learninfosFetcher));
    	builder.type("Query" , t->t.dataFetcher("HeadTeacher" , eclassHeadteacherFetcher));
    	builder.type("Query" , t->t.dataFetcher("HeadTeachers" , eclassHeadteachersFetcher));
    	builder.type("Query" , t->t.dataFetcher("Eclass" , eclassFetcher));
        builder.type("Query" , t->t.dataFetcher("Eclasses" , eclassesFetcher));
        builder.type("Query" , t->t.dataFetcher("regionEclasses" , regionEclassesFetcher));
//        builder.type("Query" , t->t.dataFetcher("student" , studentFetcher));
        builder.type("Query" , t->t.dataFetcher("students" , studentsFetcher));
        builder.type("Query" , t->t.dataFetcher("arrives" , arrivesFetcher));
        builder.type("Query" , t->t.dataFetcher("arrive" , arriveFetcher));
        builder.type("Mutation" , t->t.dataFetcher("addStudent" , addStudentMutation));
        builder.type("Mutation" , t->t.dataFetcher("deleteStudent" , deleteStudentMutation));
        builder.type("Mutation" , t->t.dataFetcher("addLearninfo" , addLearninfoMutation));
        builder.type("Mutation" , t->t.dataFetcher("deleteLearninfo" , deleteLearninfoMutation));
        builder.type("Mutation" , t->t.dataFetcher("addEclass" , addEclassMutation));
        builder.type("Mutation" , t->t.dataFetcher("deleteEclass" , deleteEclassMutation));
        builder.type("Mutation" , t->t.dataFetcher("addArrives" , addArrivesMutation));
        builder.type("Mutation" , t->t.dataFetcher("deleteArrives" , deleteArrivesMutation));
        builder.type("Mutation" , t->t.dataFetcher("setEclassHeadTeacher" , addEclassHeadTeacherMutation));
        builder.type("Mutation" , t->t.dataFetcher("deleteEclassHeadTeacher" , deleteEclassHeadTeacherMutation));
        builder.type("Mutation" , t->t.dataFetcher("upgradeSchoolYear" , upgradeSchoolYearMutation));
        
        builder.type("Mutation" , t->t.dataFetcher("addStudentRecords" , addEclassRecordsMutation));
        builder.type("Mutation" , t->t.dataFetcher("deleteStudentRecords" , deleteEclassRecordsMutation));
        
        
        builder.type("Query" , t->t.dataFetcher("EclassRecordss" , eclassRecordssFetcher));
        builder.type("Query" , t->t.dataFetcher("EclassRecords" , eclassRecordsFetcher));
        
        //学生扩展信息
        builder.type("Query" , t->t.dataFetcher("StudentExtends" , extendsFetcher));
        builder.type("Mutation" , t->t.dataFetcher("addStudentExtend" , addExtendMutation));
        builder.type("Mutation" , t->t.dataFetcher("deleteStudentExtend" , deleteExtendsMutation));
        //学生家长信息
        builder.type("Query" , t->t.dataFetcher("StudentParents" , parentsFetcher));
        builder.type("Mutation" , t->t.dataFetcher("addStudentParent" , addParentsMutation));
        builder.type("Mutation" , t->t.dataFetcher("deleteStudentParent" , deleteParentsMutation));
        //学生交通信息
        builder.type("Query" , t->t.dataFetcher("StudentTraffic" , trafficsFetcher));
        builder.type("Mutation" , t->t.dataFetcher("addStudentTraffic" , addTrafficMutation));
        builder.type("Mutation" , t->t.dataFetcher("deleteStudentTraffic" , deleteTrafficMutation));
        //学生荣誉信息
        builder.type("Query" , t->t.dataFetcher("StudentHonor" , honorsFetcher));
        builder.type("Mutation" , t->t.dataFetcher("addStudentHonor" , addHonorMutation));
        builder.type("Mutation" , t->t.dataFetcher("deleteStudentHonor" , deleteHonorMutation));
        //学生奖惩信息
        builder.type("Query" , t->t.dataFetcher("StudentRewrds" , rewardsFetcher));
        builder.type("Mutation" , t->t.dataFetcher("addStudentRewards" , addRewardsMutation));
        builder.type("Mutation" , t->t.dataFetcher("deleteStudentRewards" , deleteRewardsMutation));
        //成长档案操作历史
        builder.type("Query" , t->t.dataFetcher("StudentOperating" , operatingFetcher));

        builder.type("Query" , t->t.dataFetcher("studentByIds" , studentByIdsFetcher));
    }


}
